#pragma once

#include "CSprite.h"
#include "Object.h"
#include "QuadTree.h"
#include "CPistol.h"


class CMarco : public Object
{
public:
	CQuadTree* _mquadtree;
	CSprite* Marco_Leg;
	CPistol* Bullet[8];
	vector<CPistol*> m_varrayBullets;

	float mf_vx;	//x and y VERLOCITY_X_RUN of the character
	float mf_vy;
	int mi_BodyIndex;	//use to define which body sprite is drawing
	int mi_LegIndex;	//use to define which leg sprite is drawing

	int mi_AnimateRate;
	int mi_Direction;
	int m_nbulletIndex;

	float mf_Scale;

	bool mb_IsAction;	//determine if character is action (fire, cut, throw grenade, ....)
	bool mb_IsRelax;	//determine if character is relaxing 
	bool mb_IsJump;	
	bool mb_IsShot;
	bool mb_isShot[4];
	bool mb_ShotContinue;	//determine if the character will sontinue shoting after the previous shot

	DWORD mdw_LastTime;

	CMarco (LPD3DXSPRITE, float, CQuadTree*);
	~CMarco ();

	//Load Sprites
	//
	void loadSprite(LPD3DXSPRITE);

	//update method
	//
	void update(int DeltaTime, int moveCame);
	//render method
	//
	void render();

	void Init();

	void Reset();	//reset sprite status for the new action

	void next();
	void setRect();

	//move action
	//
	void SetDirection(int);
	void Stand(void);
	void Run(int);
	void Crouch();
	void CrouchMove(int);
	void CrouchShot(void);
	void JumpUp(void);
	void JumpFar(int);

	//fight action
	//
	void Shot(void);
	void ShotUp(void);
	void ShotDown(void);
	void ThrowGrenade(void);
	void Cut(void);

	//relax action
	void Relax();
	void ScratchNose();
	void Drink();
	void Sleep();
	void Tire();

	//set medthods
	//
	void setX(int);
	void setY(int);
	void setVerlocityX(float);
	void setVerlocityY(float);
	//get methods
	//
	int GetBodyIndex(void);
	bool IsAction(void);
	bool IsRelax(void);
	bool IsJump(void);
	bool IsShot();
};